import React, { Component } from 'react'
import { connect } from 'react-redux'
import {NavLink} from 'react-router-dom'
import RouterView from '../router/RouterView'
import {Routes} from '../types/index'
import '../css/index.scss'
interface Props extends Routes{
    
}
interface State {
    
}

export class Index extends Component<Props, State> {
    state = {}

    render() {
        return (
            <div className='index'>
                <div className='main'>
                {/* 优化页面、组件性能 */}
                    <RouterView routes={this.props.routes}/>
                </div>
                <div className='footer'>
                    <NavLink to='/index/home'>首页</NavLink>
                    <NavLink to='/index/zhunt'>专题</NavLink>
                    <NavLink to='/index/class'>分类</NavLink>
                    <NavLink to='/index/car'>购物车</NavLink>
                    <NavLink to='/index/my'>我的</NavLink>
                </div>
            </div>
        )
    }
}

const mapStateToProps = (state:Props) => ({
    
})

const mapDispatchToProps = (dispatch:Function)=>({

})

export default connect(mapStateToProps, mapDispatchToProps)(Index)

//14:30 路由完成